import {get, post} from '../http';
import {baseUrl} from '/src/config/env';

const pageUrl = 'user/'
    , homeUrl = baseUrl + pageUrl;

// 上传头像Url
export const headImgUrl = homeUrl + 'updateHeadImg';
// 检测Token
export const checkToken = params => get(homeUrl + 'checkToken', params);
// 登录
export const login = data => post(homeUrl + 'login', data);
// 注册
export const register = data => post(homeUrl + 'register', data);
// 退出
export const out = data => post(homeUrl + 'out', data, true);
// 用户信息
export const getInfo = params => get(homeUrl + 'getInfo', params, true);
// 用户Key
export const getKey = params => get(homeUrl + 'getNavKey', params, true);
// 昵称变更
export const updateName = data => post(homeUrl + 'updateName', data, true);
// 密码变更
export const updatePassword = data => post(homeUrl + 'updatePassword', data, true);
// 信息变更
export const updateInfo = data => post(homeUrl + 'updateInfo', data, true);
// 获取验证码
export const getYzm = data => post(homeUrl + 'getYzm', data, true);
// 绑定手机号
export const bindPhone = data => post(homeUrl + 'bindPhone', data, true);
// 解绑手机号
export const delPhone = data => post(homeUrl + 'delPhone', data, true);
// 绑定账号
export const bindAccount = data => post(homeUrl + 'bindAccount', data, true);

